#ifndef __COMMAND_PROCESS_H
#define __COMMAND_PROCESS_H
#include "fifo_process.h"

#define USART_FIRST_TYPE      0x01   
#define USART_SECOND_TYPE     0x02   
#define USART_THIRD_TYPE      0x03
#define USART_FORTH_TYPE      0x04
#define USART_ALL_TYPE        0xFF

#pragma pack(1)
//struct communication data
struct comdata
{
	uint8_t  start;
	uint16_t length;
	uint8_t  comm;
	uint8_t  type;
	uint8_t  cmd;
	uint16_t  segtl; //总包数
	uint16_t  segno; //当前包数	
	uint8_t  data[CMD_SIZE];
//uint16_t crc16;
//uint8_t  finish;
};
#pragma pack()

uint32_t cmd_get(uint8_t *cmdBuf, struct fifo_data *fifo);
uint32_t cmd_put(struct fifo_data *fifo, uint8_t *cmdBuf, uint32_t cmdLen);
void recv_msg_package(uint8_t type,uint8_t *data,uint32_t lenth);
void recv_usart_package(uint8_t type,uint8_t *data,uint32_t lenth);
#endif


